package com.zzzyh.forumsystemclient.services.impl;

import com.zzzyh.forumsystemclient.dao.FeedbackMapper;
import com.zzzyh.forumsystemclient.model.Feedback;
import com.zzzyh.forumsystemclient.services.IFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackServiceImpl implements IFeedbackService {
    @Autowired
    private FeedbackMapper feedbackMapper;


    @Override
    public void add(Feedback feedback) {
        feedbackMapper.insertSelective( feedback);
    }

    @Override
    public List<Feedback> getFeedbackList(Integer pageNum, Integer pageSize,Integer userId) {
        return feedbackMapper.getFeedbackList((pageNum-1)*pageSize, pageSize, userId);
    }

    @Override
    public Integer total(Integer id) {
        return feedbackMapper.total(id);
    }
}
